// 导入vue核心包
import Vue from 'vue';

// 导入App.vue的vue对象
import App from './App.vue';

// 将vue-router集成到这个项目中来
import vueRouter from 'vue-router';

// 将vueRouter对象绑定到Vue对象上
Vue.use(vueRouter);

// 导入路由规则对应的组件对象
import home from './components/Home.vue';//首页
import shopcar from './components/shopcar/shopcar.vue';//购物车
import newsList from './components/news/newsList.vue';//新闻列表
import newsInfo from './components/news/newsInfo.vue';//新闻详情
import photoList from './components/photo/photoList.vue';//图片列表
import photoInfo from './components/photo/photoInfo.vue';//图片详情
import goodsList from './components/goods/goodsList.vue';//商品列表
import goodsInfo from './components/goods/goodsInfo.vue';//商品详情
import goodsDesc from './components/goods/goodsDesc.vue';//商品描述
import goodsComment from './components/goods/goodsComment.vue';//商品评论

// 定义路由规则
var router1 = new vueRouter({
	//linkActiveClass->>改变路由激活时的class名称  本来默认的是router-link-active
	//目的是为了当前的选项卡高亮显示
	linkActiveClass:'mui-active',
	routes:[
		//默认就是首页
		{path: '/', redirect: '/home'},
		{path: '/home', component: home}, //首页
		{path: '/shopcar', component: shopcar},  //购物车
		{path: '/news/newsList', component: newsList},  //新闻列表
		{path: '/news/newsInfo/:id', component: newsInfo},  //新闻详情(传参)
		{path: '/photo/photoList', component: photoList},   //图片列表
		{path: '/photo/photoInfo/:id', component: photoInfo},   //图片详情
		{path: '/goods/goodsList', component: goodsList},   //商品列表  
		{path: '/goods/goodsInfo/:id', component: goodsInfo},   //商品详情
		{path: '/goods/goodsDesc/:id', component: goodsDesc},   //商品描述
		{path: '/goods/goodsComment/:id', component: goodsComment}   //商品评论
	]
});

//导出路由
export default router1
